package com.tju.shortlink.project.config.mq;

import cn.hutool.core.lang.UUID;
import org.slf4j.MDC;
import org.springframework.amqp.AmqpException;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessagePostProcessor;


public class BasicIdMessageProcessor implements MessagePostProcessor {
    @Override
    public Message postProcessMessage(Message message) throws AmqpException {
        String messageId = UUID.randomUUID().toString(true);
        // 写入RequestID标示
        message.getMessageProperties().setMessageId(messageId);
        return message;
    }
}
